安装
安装包下载
链接:https://pan.baidu.com/s/1Nd9ilSwUqYoucVlG30eWAQ
提取码:wtxl
--来自百度网盘超级会员V5的分享
安装步骤
解压
tar -zxvf apache-dolphinscheduler-3.2.0-bin.tar.gz -C ../module/
对应的解压目录
drwxr-xr-x 5 bigdata bigdata 4096 Feb 18 2022 alert-server
drwxr-xr-x 6 bigdata bigdata 4096 Feb 18 2022 api-server
drwxr-xr-x 3 bigdata bigdata 4096 Feb 18 2022 bin
-rw-rw-r-- 1 bigdata bigdata 2398 Oct 30 14:26 gc.log
-rw-r--r-- 1 bigdata bigdata 70935 Feb 18 2022 LICENSE
drwxr-xr-x 4 bigdata bigdata 20480 Oct 30 13:43 licenses
drwxr-xr-x 5 bigdata bigdata 4096 Feb 18 2022 master-server
-rw-r--r-- 1 bigdata bigdata 83709 Feb 18 2022 NOTICE
drwxr-xr-x 6 bigdata bigdata 4096 Feb 18 2022 standalone-server
drwxr-xr-x 6 bigdata bigdata 4096 Feb 18 2022 tools
drwxr-xr-x 5 bigdata bigdata 4096 Feb 18 2022 worker-server
修改配置文件
install_env.sh
创建自动安装到指定目录
mkdir -p /home/bigdata/module/dolphinscheduler
vi /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/bin/env/install_env.sh
指定自动安装的用户和对应安装集群机器节点。
# Example for hostnames: ips="ds1,ds2,ds3,ds4,ds5", Example for IPs: ips="192.168.8.1,192.168.8.2,192.168.8.3,192.168.8.4,192.168.8.5"
ips=${ips:-"master1,master2,node1"}
# Port of SSH protocol, default value is 22. For now we only support same port in all `ips` machine
# modify it if you use different ssh port
sshPort=${sshPort:-"22"}
# A comma separated list of machine hostname or IP would be installed Master server, it
# must be a subset of configuration `ips`.
# Example for hostnames: masters="ds1,ds2", Example for IPs: masters="192.168.8.1,192.168.8.2"
masters=${masters:-"master1,master2"}
# A comma separated list of machine <hostname>:<workerGroup> or <IP>:<workerGroup>.All hostname or IP must be a
# subset of configuration `ips`, And workerGroup have default value as `default`, but we recommend you declare behind the hosts
# Example for hostnames: workers="ds1:default,ds2:default,ds3:default", Example for IPs: workers="192.168.8.1:default,192.168.8.2:default,192.168.8.3:default"
workers=${workers:-"master1:default,master2:default,ds3:default,node1:default"}
# A comma separated list of machine hostname or IP would be installed Alert server, it
# must be a subset of configuration `ips`.
# Example for hostname: alertServer="ds3", Example for IP: alertServer="192.168.8.3"
alertServer=${alertServer:-"node1"}
# A comma separated list of machine hostname or IP would be installed API server, it
# must be a subset of configuration `ips`.
# Example for hostname: apiServers="ds1", Example for IP: apiServers="192.168.8.1"
apiServers=${apiServers:-"node1"}
# The directory to install DolphinScheduler for all machine we config above. It will automatically be created by `install.sh` script if not exists.
# Do not set this configuration same as the current path (pwd). Do not add quotes to it if you using related path.
installPath=${installPath:-"/home/bigdata/module/dolphinscheduler"}
# The user to deploy DolphinScheduler for all machine we config above. For now user must create by yourself before running `install.sh`
# script. The user needs to have sudo privileges and permissions to operate hdfs. If hdfs is enabled than the root directory needs
# to be created by this user
deployUser=${deployUser:-"bigdata"}
# The root of zookeeper, for now DolphinScheduler default registry server is zookeeper.
# It will delete ${zkRoot} in the zookeeper when you run install.sh, so please keep it same as registry.zookeeper.namespace in yml files.
# Similarly, if you want to modify the value, please modify registry.zookeeper.namespace in yml files as well.
zkRoot=${zkRoot:-"/dolphinscheduler"}
dolphinscheduler_env.sh
创建对应的数据库和用户
mysql -uroot -p123456
CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create user 'dolphinscheduler'@'%' IDENTIFIED WITH mysql_native_password by 'dolphinscheduler';
grant ALL PRIVILEGES ON dolphinscheduler.* to 'dolphinscheduler'@'%';
flush privileges;
vi /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/bin/env/dolphinscheduler_env.sh
指定储存元数据信息的数据库,和jdk位置和hadoop的位置。
# JAVA_HOME, will use it to start DolphinScheduler server
export JAVA_HOME=${JAVA_HOME:-/home/bigdata/module/jdk1.8.0_161}
# Database related configuration, set database type, username and password
export DATABASE=mysql
export SPRING_PROFILES_ACTIVE=${DATABASE}
export SPRING_DATASOURCE_URL="jdbc:mysql://10.240.8.55:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&useSSL=false"
export SPRING_DATASOURCE_USERNAME=dolphinscheduler
export SPRING_DATASOURCE_PASSWORD=dolphinscheduler
# DolphinScheduler server related configuration
export SPRING_CACHE_TYPE=${SPRING_CACHE_TYPE:-none}
export SPRING_JACKSON_TIME_ZONE=${SPRING_JACKSON_TIME_ZONE:-UTC}
export MASTER_FETCH_COMMAND_NUM=${MASTER_FETCH_COMMAND_NUM:-10}
# Registry center configuration, determines the type and link of the registry center
export REGISTRY_TYPE=${REGISTRY_TYPE:-zookeeper}
export REGISTRY_ZOOKEEPER_CONNECT_STRING=master1:2181,master2:2181,node1:2181
# Tasks related configurations, need to change the configuration if you use the related tasks.
export HADOOP_HOME=${HADOOP_HOME:-/home/bigdata/module/hadoop-3.2.3}
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/home/bigdata/module/hadoop-3.2.3/etc/hadoop}
#export SPARK_HOME=${SPARK_HOME:-/opt/soft/spark}
#export PYTHON_LAUNCHER=${PYTHON_LAUNCHER:-/opt/soft/python}
#export HIVE_HOME=${HIVE_HOME:-/opt/soft/hive}
#export FLINK_HOME=${FLINK_HOME:-/opt/soft/flink}
#export DATAX_LAUNCHER=${DATAX_LAUNCHER:-/opt/soft/datax/bin/python3}
初始化数据库
官方初始化案例
复制驱动
cp /home/bigdata/software/mysql-connector-j-8.0.31.jar /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/api-server/libs
cp /home/bigdata/software/mysql-connector-j-8.0.31.jar /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/alert-server/libs
cp /home/bigdata/software/mysql-connector-j-8.0.31.jar /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/master-server/libs
cp /home/bigdata/software/mysql-connector-j-8.0.31.jar /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/worker-server/libs
cp /home/bigdata/software/mysql-connector-j-8.0.31.jar /home/bigdata/module/apache-dolphinscheduler-3.2.0-bin/tools/libs
初始化元数据信息
bash tools/bin/upgrade-schema.sh
执行安装
集群安装
bash ./bin/install.sh
安装以后其他启动服务的命令(这个再对应的安装目录下面去启动)
# 一键停止集群所有服务
bash ./bin/stop-all.sh
# 一键开启集群所有服务
bash ./bin/start-all.sh
# 启停 Master
bash ./bin/dolphinscheduler-daemon.sh stop master-server
bash ./bin/dolphinscheduler-daemon.sh start master-server
# 启停 Worker
bash ./bin/dolphinscheduler-daemon.sh start worker-server
bash ./bin/dolphinscheduler-daemon.sh stop worker-server
# 启停 Api
bash ./bin/dolphinscheduler-daemon.sh start api-server
bash ./bin/dolphinscheduler-daemon.sh stop api-server
# 启停 Alert
bash ./bin/dolphinscheduler-daemon.sh start alert-server
bash ./bin/dolphinscheduler-daemon.sh stop alert-server
访问
访问安装api的机器node1
浏览器访问地址 http://node1:12345/dolphinscheduler/ui 即可登录系统 UI。默认的用户名和密码是 admin/dolphinscheduler123
在线修改配置
- 每个服务在路径 conf/dolphinscheduler_env.sh 中都有 dolphinscheduler_env.sh 文件,这是可以为微 服务需求提供便利。意味着您可以基于不同的环境变量来启动各个服务,只需要在对应服务中配置 conf/dolphinscheduler_env.sh 然后通过 bin/start.sh 命令启动即可。
- 但是如果您使用命令 /bin/dolphinscheduler-daemon.sh start 启动服务器,它将会用文件 bin/env/dolphinscheduler_env.sh 覆盖 conf/dolphinscheduler_env.sh 然后启动服务,目的是为了减少用户修改配置的成本。
也就是说如果就是配置单个服务的话,那么就在安装的目录修改配置文件以后,bin/start.sh 命令启动即可。如果是所有的机器都要修改,那么就用安装节点执行/bin/dolphinscheduler-daemon.sh start。